import request from '@/utils/request'

// 查询资产评级列表
export function listDealAssetRating(query) {
  return request({
    url: '/rating/dealAssetRating/list',
    method: 'get',
    params: query
  })
}

// 查询资产评级详细
export function getDealAssetRating(id) {
  return request({
    url: '/rating/dealAssetRating/' + id,
    method: 'get'
  })
}

// 保存资产评级
export function saveDealAssetRating(data) {
  return request({
    url: '/rating/dealAssetRating/save',
    method: 'post',
    data: data
  })
}

// 删除资产评级
export function delDealAssetRating(id) {
  return request({
    url: '/rating/dealAssetRating/' + id,
    method: 'delete'
  })
}

// 导出资产评级
export function exportDealAssetRating(query) {
  return request({
    url: '/rating/dealAssetRating/export',
    method: 'get',
    params: query
  })
}

// 统计资产评级 每个评级的项目数量
export function countAssetRatingNum() {
  return request({
    url: '/rating/dealAssetRating/countAssetRatingNum',
    method: 'get'
  })
}

// 统计资产评级 每个评级的投资金额
export function countAssetRatingAmount() {
  return request({
    url: '/rating/dealAssetRating/countAssetRatingAmount',
    method: 'get'
  })
}

// 查询全部资产评级列表 只获取每个项目最新的
export function findLatestByGroupByDealId(params) {
  return request({
    url: '/rating/dealAssetRating/findLatestByGroupByDealId',
    method: 'get',
    params: params
  })
}

// 新增带出项目数据
export function findDealById(dealId) {
  return request({
    url: '/rating/dealAssetRating/findDealById/' + dealId,
    method: 'get'
  })
}

// 新增带出评级标准数据
export function addConFigIndex(dealType) {
  return request({
    url: '/rating/dealAssetRating/addConFigIndex/' + dealType,
    method: 'get'
  })
}
